package com.muyi.app;

import com.muyi.spring.annotation.Autowired;
import com.muyi.spring.annotation.Value;
import com.muyi.spring.annotation.Component;
import com.muyi.spring.beans.BeanNameAware;
import com.muyi.spring.beans.InitializingBean;

@Component
public class UserServiceImpl implements UserService, BeanNameAware, InitializingBean {

    private String beanName;

    @Value(value = "三木易不爱卷")
    private String value;

    @Autowired
    private AutowiredBean auto;

    @Override
    public void test() {
        System.out.println("value: "+ value);
        System.out.println("beanName: "+ beanName);
        System.out.print("AutowiredBean: ");
        auto.test();
    }

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("UserServiceImpl InitializingBean afterPropertiesSet");
    }
}
